home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / IQUESTNS.CMD < prev    next >
Encoding:
Text File  |  1996-02-16  |  1.8 KB  |  112 lines

  1. #    IQuest Network Services Trumpet Login.cmd
  2. #
  3. #trace on
  4. #
  5. # set up some strings for dialling up
  6. #
  7. if ![load $number]
  8.   if [query $number "Enter your dial up phone number"]
  9.     save $number
  10.   end
  11. end
  12. if ![load $username]
  13.   if [username "Enter your login username"]
  14.     save $username
  15.   end
  16. end
  17. if ![load $password]
  18.   if [password "Enter your login password"]
  19.     save $password
  20.   end
  21. end
  22. if ![load $modemsetup]
  23.   $modemsetup = "&f"
  24. end
  25. $prompt = ">"
  26. $userprompt = "ogin:"
  27. $passprompt = "assword:"
  28. $slipcmd = "slip"
  29. $addrtarg = " to "
  30. $pppcmd = "ppp"
  31. $pppprompt = "beginning...."
  32.  
  33. %attempts = 3
  34. #
  35. #
  36. #----------------------------------------------------------
  37. #
  38. # initialize modem
  39. #
  40. output "atz"\13
  41. if ! [input 10 OK\n]
  42.   display "Modem is not responding"\n
  43.   abort
  44. end
  45. #
  46. # setup our modem commands
  47. #
  48. output $modemsetup\13
  49. input 10 OK\n
  50. #
  51. # send phone number
  52. #
  53. %n = 0
  54. repeat
  55.   if %n = %attempts
  56.     display "Too many dial attempts"\n
  57.     abort
  58.   end
  59.   output "atdt"$number\13
  60.   %ok = [input 50 CONNECT]
  61.   %n = %n + 1
  62. until %ok
  63. input 10 \n
  64. #
  65. #  wait til it's safe to send because some modem's hang up
  66. #  if you transmit during the connection phase
  67. #
  68. wait 30 dcd
  69. #
  70. # now prod the terminal server
  71. #
  72. output \13
  73. #
  74. #  wait for the username prompt
  75. #
  76. input 30 $userprompt
  77. output $username\13
  78. #
  79. # and the password
  80. #
  81. input 30 $passprompt
  82. output $password\13
  83. #
  84. # we are now logged in
  85. #
  86. # input 30 $prompt
  87. if %ppp
  88.   #
  89.   # jump into ppp mode
  90.   #
  91.   input 30 $pppprompt
  92.   # output $pppcmd\13
  93.   #
  94.   # input 30 \n
  95.   #
  96.   # display "PPP mode selected.  Will try to negotiate IP address."\n
  97.   #
  98. else
  99.   #
  100.   # wait for the address string
  101.   #
  102.   input 30 $addrtarg
  103.   #
  104.   # parse address
  105.   #
  106.   address 30
  107.   #
  108.   display \nConnected.  Your IP address is \i.\n
  109. end
  110. #
  111. # now we are finished.
  112. #